UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TlnnaxzFHkuJfax4y3X7Iu9BGke2kiYNEMacpinVaYs=' 
WHERE 
  key_id = '1b355017026c9dcf4305e54b83fcdb2c64dc26326c3d02c160b0e47e5aa9f653' 
  AND (
    token = 'TlnnaxzFHkuJfax4y3X7Iu9BGke2kiYNEMacpinVaYs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040