UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Ot7lH9srsHGjmhePc5J2bD44YZIdwGvJjJ3DjNiGDk='
WHERE
key_id = '48cc54fdae225a799b7aafdc666c28252e2f674918e3e78069d08c59dd52baa9'
AND (
token = '7Ot7lH9srsHGjmhePc5J2bD44YZIdwGvJjJ3DjNiGDk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)