UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '87SBZA/ciuk6vNRSCxt34N7tQvFgmYESPN00LcxYuRM='
WHERE
key_id = '710e8e6f5cf3ce658f7e7d1bf5243186f922a223d6a83d07d7786d067eddadc5'
AND (
token = '87SBZA/ciuk6vNRSCxt34N7tQvFgmYESPN00LcxYuRM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)