UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c3CIY/P/wnY5Kz3Mpb34OqsJy45bFeEPVaULQMsBtKA='
WHERE
key_id = 'ab7b7f5359fb3186191ea5debc920bb8ee6fd5ff35d0ac959ab8a1b1fa9f3d98'
AND (
token = 'c3CIY/P/wnY5Kz3Mpb34OqsJy45bFeEPVaULQMsBtKA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)