UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wsll5C8dNkX9UcHrhpwqlhgrIRIii5J3NmMKU8/BvX0=' 
WHERE 
  key_id = '15abc90694cdbf50ab4de67362df57de2197e1012896d8d74753baf32f8ddb72' 
  AND (
    token = 'Wsll5C8dNkX9UcHrhpwqlhgrIRIii5J3NmMKU8/BvX0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046