UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nFiCCTwDYNnwJlMXHGieuWecWJUxBtt+MMPtWrCko1w='
WHERE
key_id = 'a54c5ee9060a3ae7e1db334588bfd79da7e495162631fa7881cb89ac3b6fa6fa'
AND (
token = 'nFiCCTwDYNnwJlMXHGieuWecWJUxBtt+MMPtWrCko1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)