UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0RxeDe+1LQo1TKdSCl7TAVpePM/VILK/iW6wt3cJ9ys=' 
WHERE 
  key_id = 'ec2ae40953052196e98c4315ff77aaecd03443bd3e1144c912404e18ee8b47c2' 
  AND (
    token = '0RxeDe+1LQo1TKdSCl7TAVpePM/VILK/iW6wt3cJ9ys=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022