UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xrgl0TGXDjdY74X8AD6huXPJQ20tmYusHIHQ80CBcYk='
WHERE
key_id = '576bda573ec16c6d3a0c37254a832ed9d217a33699ba56adffa4a294893720fc'
AND (
token = 'Xrgl0TGXDjdY74X8AD6huXPJQ20tmYusHIHQ80CBcYk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)