UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iH8YaLqmZZEzecFHS2+p/nuW4lVfi5DthQG2rBwg7Ns='
WHERE
key_id = 'df885cbbcafa3f3b34ea81809b6a1ff9b2303ca235b374468611decaffc9d34b'
AND (
token = 'iH8YaLqmZZEzecFHS2+p/nuW4lVfi5DthQG2rBwg7Ns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)