UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lnZ7Y2a1lgH3reGVPgFNzS0lj4G8C+q9xFjnh+zI3PA='
WHERE
key_id = '17d4e930698f4e50e3e58366cad9c95f8e42092ebae41266edd0a9aebc648a75'
AND (
token = 'lnZ7Y2a1lgH3reGVPgFNzS0lj4G8C+q9xFjnh+zI3PA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)