UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kT0xOUF8tMSAYwGbClsPxTVVnmbd2COVDhZG2gHjZis='
WHERE
key_id = '7e4850228a2c85c2342312bba4dd437d079de06a7cb0bb49b0cace88b4461d5e'
AND (
token = 'kT0xOUF8tMSAYwGbClsPxTVVnmbd2COVDhZG2gHjZis='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)