UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E2GFUpS1+KUXdQb7uv9T33wje05I09XvZAjSieJfEI8=' 
WHERE 
  key_id = '6353c08e0e8c5e2ca11176643d7953ef35bff34a1f0ce8eeb3b928fbb8668719' 
  AND (
    token = 'E2GFUpS1+KUXdQb7uv9T33wje05I09XvZAjSieJfEI8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030