UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Le6gnpEIMFNtGsgqQl5N7Zan05JccFzxR27q1LehwX4=' 
WHERE 
  key_id = 'f6898a1e6815abafbc06b9ba8a476ad11f515c089c777ce6d0098e9b1134fb75' 
  AND (
    token = 'Le6gnpEIMFNtGsgqQl5N7Zan05JccFzxR27q1LehwX4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015