UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AvXsetP+jPBV5uQVDZo90WclnDzYPCeKsDerhMrMhX8='
WHERE
key_id = 'f0c557af4f5740bcb5c40ce095d73ed4b49a96bbcb83ab2e874298b7546c538f'
AND (
token = 'AvXsetP+jPBV5uQVDZo90WclnDzYPCeKsDerhMrMhX8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)