UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zgKj1vbMv/DcS0nSt1kxDWyFGMQfhlkmwKM3XwwsIok='
WHERE
key_id = 'dfc69c2abcfbee26711d6975aeed984bcbcb6c779bee638e9fd09a4ec972aa6a'
AND (
token = 'zgKj1vbMv/DcS0nSt1kxDWyFGMQfhlkmwKM3XwwsIok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)