UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '28YW5lnqWNEJofcwEwmwGjes3jefiSynzUXa48kH+To='
WHERE
key_id = '6e6abab1da74d620f44e2fc718740977f3ed3ba3c439aacad273dcbef8e1f115'
AND (
token = '28YW5lnqWNEJofcwEwmwGjes3jefiSynzUXa48kH+To='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)