UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QqeCSDeYotXqJVW3dUmhfqurfNisXVW4Dtb86I/q5xE='
WHERE
key_id = 'e9973f078f762ba280d4a517a039874cfacaa153e8184284897ecafd343d24bb'
AND (
token = 'QqeCSDeYotXqJVW3dUmhfqurfNisXVW4Dtb86I/q5xE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)