UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MpIQi3a48t5UwN7j/HEMSUS61M4X6ldj2rnK9bN5XCw='
WHERE
key_id = 'e390951f682258515bf737f3e946a9cd1dd9406d1ebba92754c46b53d80b7078'
AND (
token = 'MpIQi3a48t5UwN7j/HEMSUS61M4X6ldj2rnK9bN5XCw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)