UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4OX8DvidUzJuz9zKN6ncd4XgUR2zLOdLKUIKDr2tyrI='
WHERE
key_id = '20a5287112a0e35813c217a33bd648e22b0f4cbc6edbe47224c7e6aa89c3f4fb'
AND (
token = '4OX8DvidUzJuz9zKN6ncd4XgUR2zLOdLKUIKDr2tyrI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)