UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bhh3cQGQkUxylDEhZ3yyzL794nk548WTxGlwN0gyxBw='
WHERE
key_id = 'c9c8bbb7c008fa6b2f026870f071afd64009ebda21e1e3a0c4ffd1fd58d2d28d'
AND (
token = 'Bhh3cQGQkUxylDEhZ3yyzL794nk548WTxGlwN0gyxBw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)