UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5AGZ/MsG5iY9HdaojfiBh4nM9sMTVbb7ibFi4NQGIWg='
WHERE
key_id = '216c76e7b30e13273c45e7669f4c7cfcca55cbbb9faaf6e889a06b2b9eae473c'
AND (
token = '5AGZ/MsG5iY9HdaojfiBh4nM9sMTVbb7ibFi4NQGIWg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)