UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D2HLZSwC080wkZ7pctVGzDCSymVt0ga2ePFa1CEgx6A='
WHERE
key_id = '3648e7812d459697626c04ba341f43d49d268a0e3159f3f61e09cb762123e58b'
AND (
token = 'D2HLZSwC080wkZ7pctVGzDCSymVt0ga2ePFa1CEgx6A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)