UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4dfp2zumThTKm6G2+aZZAa1xF/XP+eNBO9m7tUIg0sY=' 
WHERE 
  key_id = 'e942adf18bbb8d7c7344e860ae04edad177ee0b10ec0c0bed78ef1ec9752156e' 
  AND (
    token = '4dfp2zumThTKm6G2+aZZAa1xF/XP+eNBO9m7tUIg0sY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027