UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x3ePy9Epy0KhXldw70rQQ8c2G1NBhV0ylhnRpuMBHSk='
WHERE
key_id = 'c95597a3e7e5955f5916ffe058d50fb14dcd82072a7cda9b7c540d49ac60735c'
AND (
token = 'x3ePy9Epy0KhXldw70rQQ8c2G1NBhV0ylhnRpuMBHSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)