UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ADPKNHSvmpCu2W5cKX+GSLt2iPewsPkE/sFgxDFhbQE='
WHERE
key_id = 'c1829bd193b2ef2d06bce9e39aa2abeade096c4a56f3f5e0200f6c5087ab5473'
AND (
token = 'ADPKNHSvmpCu2W5cKX+GSLt2iPewsPkE/sFgxDFhbQE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)