UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wxyYxxr6mbZLnFc8JNEdUuQ8j/44CVu17Z8bUfnsdbs=' 
WHERE 
  key_id = 'af6565a6b6dcfc7e9f23aa6bd70dcc4755265195c07a8ac5f68807295fd3bded' 
  AND (
    token = 'wxyYxxr6mbZLnFc8JNEdUuQ8j/44CVu17Z8bUfnsdbs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023