UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y2guKgSypEqq0+/3fRkEAJUABdZxfuI/i6jALz/VgJQ=' 
WHERE 
  key_id = '5411f39756eeb8a461494ed079450fcaca1d7aad34ccb34a53dd37cd3906b636' 
  AND (
    token = 'y2guKgSypEqq0+/3fRkEAJUABdZxfuI/i6jALz/VgJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016