UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jWy0Iew1+hl+VwPybYgYsvIp1OpLHefmmBSUjGGeUQE='
WHERE
key_id = '912760c3ee35634b6231498de68d309c89b196af36e4a7f2a95b6c73c4113381'
AND (
token = 'jWy0Iew1+hl+VwPybYgYsvIp1OpLHefmmBSUjGGeUQE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)