UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QaIEMLshUPRmkLb9F39lIWOaqpqXwlxcU1kgCiapBKo='
WHERE
key_id = '09f54161dea9b0326babd6f5e7ac0383b6fbba79c6abe5bb7aa4ad722e0abeb5'
AND (
token = 'QaIEMLshUPRmkLb9F39lIWOaqpqXwlxcU1kgCiapBKo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)