UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'COQUk5d1nX9P/lo9ZR63eKq+ZFpvjp+XnayUqz5/Kjg=' 
WHERE 
  key_id = 'c856667cb3c08bd3cfe4f984abaeaa0ad8536b0d603a82b11a99cd038aa99de9' 
  AND (
    token = 'COQUk5d1nX9P/lo9ZR63eKq+ZFpvjp+XnayUqz5/Kjg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016