UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/7HVs3k53Po052vK8HS1DgmAllNgxuv/NCVzHnPzpB8=' 
WHERE 
  key_id = '1091abcd6b904fd1135396abef222e59caaa2dedd228a0dd72361e42fd68b442' 
  AND (
    token = '/7HVs3k53Po052vK8HS1DgmAllNgxuv/NCVzHnPzpB8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031