UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QPpJZR3Rkc4fpZjmS1CcDuDrymfM4A5X3/CCabP2SgM='
WHERE
key_id = 'e79aa5e77e1a9c68f4bd4210f3d7e7511ff95a77a5369b3112294ee5ae207413'
AND (
token = 'QPpJZR3Rkc4fpZjmS1CcDuDrymfM4A5X3/CCabP2SgM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)