UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kIVq+BAnaXRhfA3VRA540o69mYRYox7kH3RNDytCI8k=' 
WHERE 
  key_id = '7b5c7d34cbe692dac15ed1f5fbe31975eefbc6de0e69d34fe3d24e7786c47a8c' 
  AND (
    token = 'kIVq+BAnaXRhfA3VRA540o69mYRYox7kH3RNDytCI8k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030