UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LrqE7M7wC95PFyzyAMhuEYRY7mDTLbdcdP5xBZ7M+eA=' 
WHERE 
  key_id = '21a42d4638767665e74fa436b3d249544d9e660015f09beacafc3ccf116118b7' 
  AND (
    token = 'LrqE7M7wC95PFyzyAMhuEYRY7mDTLbdcdP5xBZ7M+eA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019