UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vrvvGFmKdyoCAx0klBgZIfY5CW0UqRiN5AZM887SX8Q='
WHERE
key_id = '726395d26b410e0c66c6e201cab4f3082f537c790b6b6da8442fecc87c4f3379'
AND (
token = 'vrvvGFmKdyoCAx0klBgZIfY5CW0UqRiN5AZM887SX8Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)