UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EmMOV1rrl++lw3+48bsfinl6Jo2fOBaPxUiqT1kPLOs='
WHERE
key_id = '06d0cfb3ad57272b3ee886d0ef8921b886264156c87ee7ce91b294e03a626ecc'
AND (
token = 'EmMOV1rrl++lw3+48bsfinl6Jo2fOBaPxUiqT1kPLOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)