UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y7mv61XgtPjoBg/YQByWWcG/jGO7ft8pKI/HRZPOCPw='
WHERE
key_id = '9c6bf26dfa85c51e5f831f3f958297c740630658804606eed6e6dcbf58f5a7d9'
AND (
token = 'y7mv61XgtPjoBg/YQByWWcG/jGO7ft8pKI/HRZPOCPw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)