UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0OegDU8RmbHkjpqDljdnBGgep1xS6RT32J+Rc+p+4sc='
WHERE
key_id = 'e72faa47b95253324c192d0b1170795530d3a8040ebaa0a3a12fc036459c1f35'
AND (
token = '0OegDU8RmbHkjpqDljdnBGgep1xS6RT32J+Rc+p+4sc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)