UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vf2rvWKlIX7HSEjEmeC4OPKOpzJQzB743rHPJeGfh1g='
WHERE
key_id = '6b8363cc4f74b1947cb77ae7be385ad336e4cd2c072f0d4d305246194746ee9f'
AND (
token = 'vf2rvWKlIX7HSEjEmeC4OPKOpzJQzB743rHPJeGfh1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)