UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T+MTwtZ7XLQAJTcVfdM/4hh80Z/oe4DSt74atMKJDK4='
WHERE
key_id = '51628333eaab7dcfe715b443316e5d181771f8e8e2defa84d9999b2fa97c2f1d'
AND (
token = 'T+MTwtZ7XLQAJTcVfdM/4hh80Z/oe4DSt74atMKJDK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)