UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5c8mpjNBgML+dIjuBSsB4XGr8ITP15lvZcC1f059Dnw='
WHERE
key_id = 'd6aa2c628f41ac268d6da402eac00de98219ad9b675e2b7f38afab01590a8763'
AND (
token = '5c8mpjNBgML+dIjuBSsB4XGr8ITP15lvZcC1f059Dnw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)