UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WzyDBTZi54oRpJZEzpNrpF+DzQZDH2haBUDe7Ozl56s='
WHERE
key_id = 'a7db4f4b1e3ccbb3d11415ebe6f89f10771540c5b78cb4cac0819f591ba66646'
AND (
token = 'WzyDBTZi54oRpJZEzpNrpF+DzQZDH2haBUDe7Ozl56s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)