UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rxWdnmClMV9Hvpx9fDvo42Y+HBpz6V2rQGA0uKHxBLY=' 
WHERE 
  key_id = '27f247fa61c411415e19cbe96b36b33ca7a0f74c44ad5b0ae52074f1c031f19f' 
  AND (
    token = 'rxWdnmClMV9Hvpx9fDvo42Y+HBpz6V2rQGA0uKHxBLY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039