UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tndI3cK8pI93zIgZhPQimpcVWn8RKGvVMxTh/4fTy2k='
WHERE
key_id = '5e4d069c4bf9c25f42ae5a422f09201e2e00eecea56aab40c8d5000ab8dd086a'
AND (
token = 'tndI3cK8pI93zIgZhPQimpcVWn8RKGvVMxTh/4fTy2k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)