UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M4kMpkexjNijXFyZWkvJ26HocvgK65JOecGGdGP1TJw='
WHERE
key_id = '1c7aafbde0ac2c200a29ece9976685a1fa5b66543a38e62e1bf05498bd529754'
AND (
token = 'M4kMpkexjNijXFyZWkvJ26HocvgK65JOecGGdGP1TJw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)