UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GUIyT0FK1VT/7ZqxKQOWqpWpkKvIPRTfANTzoldKf0c='
WHERE
key_id = '18d3fc356ac52a7a29deca0ae41179346c3c99074f4a14c85052433f6a6ae01e'
AND (
token = 'GUIyT0FK1VT/7ZqxKQOWqpWpkKvIPRTfANTzoldKf0c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)