UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0QE4dMEZmIWJB3tEPtQ1aE9q4djOLKdpO28k+/O9isY='
WHERE
key_id = '72ea0a7a5221e7b0eae22386d2e0d9f46bc2ed4cf67a1171ac9650bd1484d813'
AND (
token = '0QE4dMEZmIWJB3tEPtQ1aE9q4djOLKdpO28k+/O9isY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)