UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2TgzcPb1wa985TnKF5MivpyUqyWxGnfZ89ODVL/Dysw='
WHERE
key_id = '426964d681ee8881bf21de590c86db9bf047168e2ea84cb264c925599ce77609'
AND (
token = '2TgzcPb1wa985TnKF5MivpyUqyWxGnfZ89ODVL/Dysw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)