UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VPmEyDOFxD3+1Utbrqe0LzFvbf84g3NxSQKjxMn3nCk=' 
WHERE 
  key_id = '2b7f57472e87e81805c9039c4e01306a280d1475184fc3a437eb854fae3b1201' 
  AND (
    token = 'VPmEyDOFxD3+1Utbrqe0LzFvbf84g3NxSQKjxMn3nCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038