UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n7E+l8+laauDlkjNIY+jC7LxLLJNPJBltYgbBV9NmYw='
WHERE
key_id = '28ded82dc36553ca6a13fd7c09ede961e6e5c992d0dea47d5b243169cd2c8d2e'
AND (
token = 'n7E+l8+laauDlkjNIY+jC7LxLLJNPJBltYgbBV9NmYw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)